const seq = require('sequelize');
const db = require('../config/database');
const Model = db.defineModel('xs_user', {
	username: {
		type: seq.STRING(20),
		comment: '用户名称',
		unique: true
	},
	userpass: {
		type: seq.STRING(50),
		comment: '用户密码'
	},
	nickname: {
		type: seq.STRING(50),
		allowNull: true,
		comment: '用户昵称'
	},
	useravatar: {
		type: seq.INTEGER,
		allowNull: true,
		comment: '用户头像'
	},
	booknotice: {
		type: seq.TEXT,
		allowNull: true,
		comment: '小说简介'
	},
	booktype: {
		type: seq.STRING(60),
		comment: '小说类型'
	},
	createtime: {
		type: seq.BIGINT(13),
		comment: '创建时间'
	},
	updatetime: {
		type: seq.BIGINT(13),
		comment: '更新时间'
	}
});
Model.beforeCreate((model, options) => {
	console.log(model, options);
});
module.exports = Model;
